<template>
	<view class="container">
		<!-- 导航栏 -->
		<u-navbar :safeAreaInsetTop="true" leftIconSize="23px" leftIconColor="#ffffff" bgColor="#ffffff00"
			:autoBack="true" height="0px">
		</u-navbar>
		<!-- 轮播图 -->
		<u-swiper height="500" radius="40rpx" :list="banners"></u-swiper>

		<!-- 球场信息 -->
		<view class="stadiumBox">
			<!-- 球场信息 -->


			<view style="display: flex;justify-content: left;" class="padding10-30">
				<u--text bold size="40" text="物资那大球场"></u--text>
			</view>

			<view class="space-between">
				<view style="display: flex;justify-content: left;" class="padding10-30">
					<view style="margin-right: 2%;" v-for="item in 2" class="tag">
						<text>生死局</text>
					</view>
				</view>

				<view style="color: #9593A4;">
					<view class="padding10-30" style="font-size: 20rpx;">
						<text>已约: 99场</text>
					</view>
				</view>
			</view>

			<!-- 开放日和导航 -->
			<view> 
				<view style="display: flex;justify-content: space-around; padding: 20rpx; 5rpx">
					<view class="gameInfo" style="width: 40%; background-color: #F4F7FE;">
						<view class="padding10-30">
							<u--text size="20" text="每周六,日"></u--text>
							<u--text size="20" text="10:00-22:00"></u--text>
							<u--text size="20" text="开放"></u--text>
						</view>

						<view class="padding10-30">
							<u-icon name="photo" color="#2979ff" size="28"></u-icon>
						</view>
					</view>

					<view   class="gameInfo"
						style="width: 60%;background: linear-gradient(270deg, rgba(239, 250, 246, 0.78) 0%, #F6FAFD 95%);">
						<view class="padding10-30">
							<u--text size="20" text="每周六,日"></u--text>
							<u--text size="20" text="10:00-22:00"></u--text>
							<u--text  size="20" text="开放1"></u--text>
						</view>

						<view @click="toNavigation()" class="padding10-30">
							<u-icon name="photo" color="#2979ff" size="28"></u-icon>
						</view>

					</view>
				</view>

				<view class="gameInfo" style="width: 93%; background-color: #F2F3F5; margin: 0 auto;">
					<view class="padding10-30">
						<u--text size="20"
							text="00:01:44.501项目'footballBookingApp' 编译成功。前端运行日志，请另行在小程序开发工具的控制台查看00:01:44.501 项目 'footballBookingApp' 编译成功。前端运行日志，请另行在小程序开发工具的控制台查看"></u--text>

					</view>
				</view>

			</view>

		</view>

		<!-- 球场预定 -->
		<view class="space-between" style="margin-top: 20%">
			<view class="padding10-30">
				<u--text bold size="30" text="物资那大球场"></u--text>
			</view>
			<view class="padding10-30">
				<u--text suffixIcon="arrow-down-fill" size="20" text="5人场"></u--text>
			</view>
		</view>

		<!-- 星期 -->
		<scroll-view scroll-x="true"
			style="width: 100%;white-space: nowrap;margin-top: 3%; display: flex;justify-content: space-between;">
			<view @click="toWeekStadium(index)" :style="{'background-color': item.check ? '#4A43EC' : '#ffffff'}"
				class="weekDate" v-for="(item,index) in datas">
				<u--text :color="item.check ? '#ffffff' : '#000000'" lineHeight="20" align="center" size="20"
					:text="item.data"></u--text>
				<u--text :color="item.check ? '#ffffff' : '#000000'" lineHeight="70" align="center" bold size="28"
					:text="item.week"></u--text>
			</view>
		</scroll-view>

		<!-- 创建球局 -->

		<view class="addStadium">
			<view class="padding10-30">
				<u--text bold size="25" text="五人场"></u--text>
			</view>
			<view @click="show = true" class="padding10-30" style="width: 150rpx;">
				<u-button color="#4A43EC" shape="circle" type="success" text="创建球局"></u-button>
			</view>
		</view>

		<!-- 特价和场次 -->
		<view class="addStadium" style="height: 150rpx;display: flex;justify-content: space-around;">
			<view class="padding10-40 addStadiumBox">
				<u--text size="20" text="10:00-12:00"></u--text>
				<u--text decoration="line-through" color="#888693" size="15" text="￥500"></u--text>
				<u--text color="#F0635A" size="23" text="￥400"></u--text>


			</view>
			<view class="padding10-40 addStadiumBox">
				<u--text size="20" text="共4场"></u--text>
				<u--text color="#4A43EC" size="20" text="已定出0场"></u--text>
			</view>
		</view>

		<!-- 球局 -->
		<swiper layout-type="stackLeft" indicator-type="normal" style="height: 37%;">
			<swiper-item v-for="(item,index) in 3">
				<view class="ballGame">
					<view class="space-between">
						<view class="padding10-40">
							<u--text size="35" bold text="教个朋友局"></u--text>
							<view style="display: flex;justify-content: left;padding-top: 10rpx;">
								<view style="margin-right: 2%;" v-for="item in 2" class="tag">
									<text>生死局</text>
								</view>
							</view>
						</view>

						<view class="padding10-40">
							<view class="tag">
								<text>生死局</text>
							</view>
							<view class="padding10-30" style="width: 150rpx;">
								<u-button iconColor="#F0635A" icon="thumb-up-fill" size="mini" color="#F0635A4D"
									shape="circle" text="我参加"></u-button>
							</view>
						</view>
					</view>

					<view>
						<view class="padding10-40">
							<view class="flex">
								<u-icon size="38" name="map"></u-icon>
								<view style="margin-left: 20rpx;">
									<u--text size="28" text="足球（5人制）"></u--text>
								</view>
							</view>

							<view class="flex padding15-0">
								<u-icon size="38" name="map"></u-icon>
								<view style="margin-left: 20rpx;">
									<u--text size="28" text="￥400（AA制）"></u--text>
								</view>
							</view>
						</view>
					</view>

					<view class="gameInfo"
						style="width: 93%; height: auto; background-color: #F2F3F5; margin: 2% auto;">
						<view class="padding10-30">
							<u--text size="20"
								text="00:01:44.501项目'footballBookingApp' 编译成功。前端运行日志，请另行在小程序开发工具的控制台查看00:01:44.501 项目 'footballBookingApp' 编译成功。"></u--text>
						</view>
					</view>

					<!-- 头像 -->
					<view class="space-between margin-top-2">
						<view class="padding10-30" style="display: flex;">
							<view v-for="item in 6" style="margin-right: 2%">
								<u--image width="26px" height="26px" radius="8px" @click="toOther()"
									src="https://cdn.uviewui.com/uview/album/1.jpg"></u--image>
							</view>
						</view>
						<view class="padding10-30">
							<text>报名 12/</text>
							<text>16-30</text>
						</view>
					</view>

				</view>
			</swiper-item>
		</swiper>

		<!-- 弹出层 -->
		<u-popup :show="show" mode="bottom"
			:customStyle="{'width':'100%','height':'500rpx','border-radius': '30px 30px 0px 0px'}">
			<view class="padding10-40">
				<u--text lineHeight="100rpx" @click="toAddBallGame(1)" align="center" color="#000000" size="27"
					text="个人身份创建"></u--text>
				<u-line></u-line>
				<u--text lineHeight="100rpx" @click="toAddBallGame(2)" align="center" color="#000000" size="27"
					text="球队身份创建"></u--text>
				<u-line></u-line>
				<u--text lineHeight="100rpx" @click="toAddBallGame(3)" align="center" color="#000000" size="27"
					text="直接预定"></u--text>
				<u--text @click="show =false" lineHeight="100rpx" align="center" color="#000000" size="27"
					text="取消"></u--text>
			</view>
		</u-popup>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				banners: [
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
				datas: [{
						data: '10月12日',
						week: "今天",
						check: true
					},
					{
						data: '10月13日',
						week: "周日",
						check: false
					},
					{
						data: '10月12日',
						week: "周一",
						check: false
					},
					{
						data: '10月15日',
						week: "周二",
						check: false
					},
					{
						data: '10月12日',
						week: "周三",
						check: false
					},
					{
						data: '10月16日',
						week: "周四",
						check: false
					},
					{
						data: '10月17日',
						week: "周五",
						check: false
					},
					{
						data: '10月18日',
						week: "周六",
						check: false
					}
				]
			}
		},
		methods: {
			// 点击导航
			toNavigation() {
				console.log(321);
				wx.openLocation({
					type: 'gcj02',
					latitude: 39.92392,
					longitude: 116.411885,
					name: '最高人民检察院',
					scale: 28,
						
					fail(res) {  
					        console.log(res,'用户拒绝了位置信息授权');  
					    } 
				})
			},
			toWeekStadium(i) {
				console.log(i);
				this.datas.map((item, index) => {
					item.check = index === i ? true : false
				})
			},
			// 跳转
			toAddBallGame(i) {
				this.show = false
				console.log('222');
				uni.navigateTo({
					url: "/pages/ballGame/addBallGame?status=" + i
				})
			},
			// 跳转到用户界面
			toOther() {
				uni.navigateTo({
					url: "/subpkg/me/other"
				})
			}
		}
	}
</script>

<style>
	.container {
		width: 100%;
		height: 100vh;
	}

	.stadiumBox {

		width: 95%;
		margin: -15% auto;
		background-color: white;
		border-radius: 20rpx;
		/* padding: 10rpx; */
		padding: 20rpx 0;
		background: #FEFEFF;

		backdrop-filter: blur(21.75px);
		box-shadow: 0px 20px 20px 0px rgba(90, 90, 90, 0.1);
	}



	.gameInfo {
		padding: 20rpx 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 100%;
		border-radius: 24rpx;
		opacity: 1;
		background: #FFFFFF;
		box-sizing: border-box;
		margin: 0 7rpx;

	}

	.weekDate {
		width: 20%;
		height: 70rpx;
		border-radius: 11.22px;
		opacity: 1;
		padding: 50rpx 20rpx;
		background: #4A43EC;
		box-shadow: 0px 4px 10px 0px rgba(83, 89, 144, 0.07);
		display: inline-block;
		margin-left: 30rpx;

	}

	.addStadium {
		width: 93%;
		height: 60px;
		border-radius: 32rpx;
		opacity: 1;
		margin: 5% auto;
		background: #E8EDFF;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.addStadiumBox {
		width: 35%;
		height: 80rpx;
		border-radius: 10px;
		background: #FFFFFF;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.ballGame {
		padding: 20rpx 0;
		width: 93%;
		height: auto;
		border-radius: 16.98px;
		opacity: 1;
		margin: 3% auto;
		background: #FFFFFF;
		box-shadow: 0px 2.12px 20px 0px rgba(83, 89, 144, 0.15);
	}
</style>